import request from '@/utils/request'

// 查询分组列表
export function listCommon(query) {
  return request({
    url: '/goods/common/list',
    method: 'get',
    params: query
  })
}

// 查询分组详细
export function getCommon(commonId) {
  return request({
    url: '/goods/common/' + commonId,
    method: 'get'
  })
}

// 查询所有分组
export function getCommonAllList() {
  return request({
    url: '/goods/common/allList',
    method: 'get'
  })
}

// 新增分组
export function addCommon(data) {
  return request({
    url: '/goods/common',
    method: 'post',
    data: data
  })
}

// 修改分组
export function updateCommon(data) {
  return request({
    url: '/goods/common',
    method: 'put',
    data: data
  })
}

// 删除分组
export function delCommon(commonIds) {
  return request({
    url: '/goods/common/' + commonIds,
    method: 'delete'
  })
}

export default {
  list:listCommon,
  get:getCommon,
  add:addCommon,
  update:updateCommon,
  del:delCommon,
  getCommonAllList:getCommonAllList
}